<div style="background-color:pink;height: 100%;width: 100%;">
    <button data-perms='sys:role:add'>新增</button>
    <button data-perms='sys:role:update'>修改</button>
    <button data-perms='sys:role:delete'>删除</button>
    <button data-perms='sys:role:info'>详情</button>

</div>
<script>
    (function () {
        $("[data-perms]").each(function (index, item) {
            var attr = $(item).attr("data-perms");
            var oPerms = JSON.parse(sessionStorage.getItem("perms") || '[]');
            if (oPerms.indexOf(attr) == -1) {
                $(item).remove()
            }
        })
    })()
</script>